﻿<ribbon:RibbonWindow x:Class="ATSMain"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
		Title="ATS Manager"
		x:Name="ATSMain"
		Width="640" Height="Auto">
	<Window.Resources>
		<Style TargetType="ListBoxItem">
			<Style.Triggers>
				<Trigger Property="ItemsControl.AlternationIndex"  Value="0">
					<Setter Property="Background" Value="AliceBlue" />
				</Trigger>
			</Style.Triggers>
		</Style>
	</Window.Resources>


	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>
		
		<ribbon:Ribbon x:Name="Ribbon" Grid.Row="0">			
			<ribbon:RibbonTab x:Name="ReaderTab"
							  Header="Reader">
				<ribbon:RibbonGroup x:Name="Group1">
					<ribbon:RibbonButton x:Name="RibbonButtonSynch"
										 LargeImageSource="/images/connectestablished-35258.png"
										 Label="Synch" />
					<ribbon:RibbonButton x:Name="buttonReaderSettings"
										 LargeImageSource="/images/settings-2770.png"
										 Label="Reader Settings" />
				</ribbon:RibbonGroup>
			</ribbon:RibbonTab>
            <ribbon:RibbonTab x:Name="DatabaseTab"
							  Header="Database">
                <ribbon:RibbonGroup x:Name="DBGroup" Header="Action">
                    <ribbon:RibbonButton x:Name="RibbonButtonDBBackup"
										 LargeImageSource="/images/download_database_64.png"
										 Label="Backup" />
                    <ribbon:RibbonButton x:Name="RibbonButtonDBRestore"
										 LargeImageSource="/images/database_upload_64.png"
										 Label="Restore" />
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
        </ribbon:Ribbon>
		<DockPanel LastChildFill="True" Grid.Row="1" HorizontalAlignment="Stretch" Width="auto">
			<DockPanel LastChildFill="False"
			   HorizontalAlignment="Stretch" Width="Auto"  DockPanel.Dock="Bottom" 
			   Background="#FFF2F2F2">
									<StackPanel Orientation="Horizontal" DockPanel.Dock="Left">
						<StackPanel Name="connectedNo" Orientation="Horizontal">
							<Image Name="imgconnectedNo" Source="/images/circlered.png" Height="16" Width="16" VerticalAlignment="Center"  />
							<Label Content="Reader not connected..." Height="25" HorizontalAlignment="Left" Name="LabelNotConnected" VerticalAlignment="Center" />
						</StackPanel>
						<StackPanel Name="connectedYes" Orientation="Horizontal">
							<Image Name="imgconnectedYes" Source="/images/circlegreen.png" Height="16" Width="16"  VerticalAlignment="Center"  />
							<Label Content="Reader connected..." Height="25" HorizontalAlignment="Left" Name="LabelConnected" VerticalAlignment="Center" />
						</StackPanel>

					</StackPanel>
				<Label Content="test"  DockPanel.Dock="Right" Width="Auto" Height="25" HorizontalAlignment="Stretch" Name="labelUser" VerticalAlignment="Center" HorizontalContentAlignment="Right" VerticalContentAlignment="Center"/>
			   
			</DockPanel>


			<StackPanel Height="Auto" VerticalAlignment="Stretch">
				
				<Grid  Name="DockpanelSynch"  VerticalAlignment="Stretch" >
				<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Name="panelConnectToReader">
					<Button Content="Connect to Reader" Height="23" Name="ButtonConnectToReader" Width="150" />
				</StackPanel>
				<StackPanel Name="panelExtractFiles"  VerticalAlignment="Stretch">
					<Label Content="Label" Height="28"  HorizontalAlignment="Right" Margin="5" Name="Label1" VerticalAlignment="Top" />
					<Button Content="Process Reader Files" Height="23" Name="ButtonProcessReaderFiles" Width="200" />
					<Grid HorizontalAlignment="Center">
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto" />
							<RowDefinition Height="Auto" />
							<RowDefinition Height="Auto" />
						</Grid.RowDefinitions>

						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>
						<Label Content="Number of files processed :" Height="28"  HorizontalAlignment="Left" Margin="5" Name="LabelNumberofFilesProcessedText" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0" />
						<Label Content="0" Height="28"  HorizontalAlignment="Left" Margin="5" Name="LabelNumberofFilesProcessed" VerticalAlignment="Top" Grid.Row="0" Grid.Column="1" />
						<Label Content="Duplicates :" Height="28"  HorizontalAlignment="Left" Margin="5" Name="LabelDuplicatesText" VerticalAlignment="Top" Grid.Row="1" Grid.Column="0" />
						<Label Content="0" Height="28"  HorizontalAlignment="Left" Margin="5" Name="LabelDuplicates" VerticalAlignment="Top" Grid.Row="1" Grid.Column="1" />
						<Label Content="Not Associated with any Asset :" Height="28"  HorizontalAlignment="Left" Margin="5" Name="LabelNoAssetText" VerticalAlignment="Top" Grid.Row="2" Grid.Column="0" />
						<Label Content="0" Height="28"  HorizontalAlignment="Left" Margin="5" Name="LabelNoAsset" VerticalAlignment="Top" Grid.Row="2" Grid.Column="1" />
					</Grid>
						<ListBox Name="listboxSynchLog" Height="250"  AlternationCount="2" ></ListBox>
					</StackPanel>
				<Control Grid.RowSpan="2"
								 x:Name="busyAnimationSaveAndDelete" 
								 Style="{StaticResource BusyAnimationStyle}"
								 Width="{Binding Path=ActualWidth, ElementName=mainGrid}" 
								 Height="{Binding Path=ActualHeight, ElementName=mainGrid}" 
				 Visibility="Collapsed" />

			</Grid>
				<Grid Name="GridSettings">
				<StackPanel>
					<StackPanel Orientation="Horizontal">
						<Button Name="BtnSaveSettings" Width="100" Content="Save" Margin="5"></Button>
						<Button Name="BtnRefreshSettings" Width="100" Content="Refresh" Margin="5"></Button>
					</StackPanel>
					<GroupBox Header="Reader file location" Margin="5">
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="auto"></ColumnDefinition>
								<ColumnDefinition Width="auto"></ColumnDefinition>
							</Grid.ColumnDefinitions>
							<TextBox Grid.Column="0" Width="250" Name="textboxReaderFilesLocation" Margin="5" IsReadOnly="True" ></TextBox>
							<Button Grid.Column="1" Name="buttonBrowseReader" Margin="5" Width="100">Browse</Button>
						</Grid>
					</GroupBox>
					<GroupBox Header="Backup files location"  Margin="5">
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="auto"></ColumnDefinition>
								<ColumnDefinition Width="auto"></ColumnDefinition>
							</Grid.ColumnDefinitions>
							<TextBox Grid.Column="0" Width="250" Name="textboxBackupFilesLocation" Margin="5" IsReadOnly="True" ></TextBox>
							<Button Grid.Column="1" Name="buttonBrowseBackup" Margin="5" Width="100">Browse</Button>
						</Grid>
					</GroupBox>
					<GroupBox Header="Reader/File Settings" Margin="5" >
						<StackPanel >
							<StackPanel Margin="5" Orientation="Horizontal" >
								<CheckBox Name="cbRemoveFilesFromReader"  Margin="1,2,1,2" IsChecked="True" VerticalAlignment="Center"></CheckBox>
								<Label Margin="1,2,1,2" VerticalAlignment="Center">Remove files from the Reader?</Label>
							</StackPanel>
							<StackPanel Margin="5" Orientation="Horizontal" >
								<CheckBox Name="cbReaderFileHeaderFirstRow"  Margin="1,2,1,2" IsChecked="True" VerticalAlignment="Center"></CheckBox>
								<Label Margin="1,2,1,2" VerticalAlignment="Center">First row contains Headers</Label>
							</StackPanel>
							<StackPanel Margin="5" Orientation="Horizontal" >
								<TextBox Width="50" Name="textboxRFIDNumLength" Margin="5"></TextBox>
								<Label Margin="1,2,1,2" VerticalAlignment="Center">RFID Number length</Label>
							</StackPanel>
							<StackPanel Margin="5" Orientation="Horizontal" >
								<TextBox Width="50" Name="textboxReaderDelimiter" Margin="5"></TextBox>
								<Label Margin="1,2,1,2" VerticalAlignment="Center">Row delimiter</Label>
							</StackPanel>
							<StackPanel Margin="5" Orientation="Horizontal" >
								<TextBox Width="150" Name="textboxReaderFileExtension" Margin="5"></TextBox>
								<Label Margin="1,2,1,2" VerticalAlignment="Center">Reader file extension. Example *.txt</Label>
							</StackPanel>
							<StackPanel Margin="5" Orientation="Horizontal" >
								<TextBox Width="150" Name="textboxReaderRowFormat" Margin="5"></TextBox>
								<Label Margin="1,2,1,2" VerticalAlignment="Center">Reader row format</Label>
							</StackPanel>
							<StackPanel Margin="5" Orientation="Horizontal" >
								<CheckBox Name="cbReaderCreateAssetData"  Margin="1,2,1,2" IsChecked="True" VerticalAlignment="Center"></CheckBox>
								<Label Margin="1,2,1,2" VerticalAlignment="Center">Create Asset data. NOTE : Asset Number will be generated from RFID No</Label>
							</StackPanel>
						</StackPanel>
					</GroupBox>
				</StackPanel>
			</Grid>
				<Grid Name="GridBackup">
                    <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
                        <Label Margin="1,2,1,2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" FontWeight="Bold">ATS Database Backup</Label>
                        <Label Margin="1,2,1,2" VerticalAlignment="Center">To change where the backup is saved, click on Browse.</Label>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                            <TextBox Width="200" Name="backupFileLocation" Margin="5" IsEnabled="False" ></TextBox>
                            <Button Content="Browse" Height="20" Name="ButtonBrowseBackupLocation"/>
                        </StackPanel>
                        <Button Content="Create Backup" Height="20" Name="ButtonCreateBackup"/>
                    </StackPanel>
                </Grid>
                <Grid Name="GridRestore">
                    <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
                        <Label Margin="1,2,1,2" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="18" FontWeight="Bold">ATS Database Restore</Label>
                        <Label Margin="1,2,1,2" VerticalAlignment="Center">To change where the backup is saved, click on Browse.</Label>
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                            <TextBox Width="200" Name="RestoreFileLocation" Margin="5" IsEnabled="False" ></TextBox>
                            <Button Content="Browse" Height="20" Name="ButtonBrowseRestoreLocation"/>
                        </StackPanel>
                        <Button Content="Restore Database" Height="20" Name="ButtonRestoreDatabase" IsEnabled="False"/>
                    </StackPanel>
                </Grid>
            </StackPanel>
		</DockPanel>

		
		</Grid>
</ribbon:RibbonWindow>
